<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg">
  <head>
    <title>Installing and using the binary distribution</title>
    <link rel="stylesheet" type="text/css" href="docbook-epub.css"/>
    <link rel="stylesheet" type="text/css" href="kawa.css"/>
    <script src="kawa-ebook.js" type="text/javascript"/>
    <meta name="generator" content="DocBook XSL-NS Stylesheets V1.79.1"/>
    <link rel="prev" href="Running-Java.xhtml" title="Getting and running Java"/>
    <link rel="next" href="Source-distribution.xhtml" title="Installing and using the source distribution"/>
  </head>
  <body>
    <header/>
    <section class="sect1" title="Installing and using the binary distribution" epub:type="subchapter" id="Binary-distribution">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both">Installing and using the binary distribution</h2>
          </div>
        </div>
      </div>
      <p>The binary release comes as a <code class="literal">.zip</code> archive that
includes Kawa itself (as a <code class="literal">.jar</code> file <code class="literal">kawa-<em class="replaceable"><code>version</code></em>.jar</code>),
some third-party helper libraries, <code class="literal">kawa</code> command scripts
(for GNU/Linux/Unix/MacOS or Windows),
and documentation (basically this manual).
</p>
      <p>After downloading (see <a class="link" href="Getting-Kawa.xhtml" title="Getting Kawa">Getting Kawa</a>), extract the files
from the <code class="literal">.zip</code> archive using a suitable <code class="literal">unzip</code> program,
which will create a directory <code class="literal">kawa-<em class="replaceable"><code>version</code></em></code>,
with <code class="literal">lib</code>, <code class="literal">bin</code>, and <code class="literal">doc</code> sub-directories.
In the following, we assume the environment variable <code class="literal">KAWA_HOME</code>
refers to this directory:
</p>
      <pre class="screen">unzip ~/Downloads/kawa-<em class="replaceable"><code>version</code></em>.zip
export KAWA_HOME=`pwd`/kawa-<em class="replaceable"><code>version</code></em>
</pre>
      <p>The binary release requires Java 7 or later.
Java 8 is recommended. (Java 8 is needed for the JLine input editor,
which is recommended for the REPL.)
If you have an older Java implementation, or build for a mobile
environment like Android,
then you will need to get the source distribution.
</p>
      <p>If you want to use Kawa as part of some other application,
you just need the <code class="literal">$KAWA_HOME/lib/kawa.jar</code>.
</p>
      <h4 id="idm139667880844256">Running the <code class="literal">kawa</code> command</h4>
      <p>To run a Kawa script file or the Kawa read-eval-print-loop
run the Kawa application.  There are various way to do so.
</p>
      <p>The recommended way is to execute the <code class="literal">$KAWA_HOME/bin/kawa</code> Bash
shell script.
This should work on most Unix-like platforms that have Bash installed,
including GNU/Linux, BSD, MacOS, and Cygwin/MingW.
(Please report if you have problems.)
</p>
      <p>The script assumes that either a suitable <code class="literal">java</code> program is
in your <code class="literal">PATH</code>; or the <code class="literal">JAVA</code> environment variable
names a suitable <code class="literal">java</code> executable; or that <code class="literal">JAVA_HOME</code>
is set so <code class="literal">$JAVA_HOME/bin/java</code> is suitable.
</p>
      <p>If you want to put <code class="literal">kawa</code> in your search path you can of course do:
</p>
      <pre class="screen">PATH=$KAWA_HOME/bin:$PATH
</pre>
      <p>Alternatively you can create a symbolic link in an already-searched directory.
For example:
</p>
      <pre class="screen">cd /usr/local/bin
ln -s $KAWA_HOME/bin/kawa kawa
</pre>
      <p>The <code class="literal">bin/kawa.bat</code> script works on Windows.
</p>
      <p>Both scripts add some helper libraries, including support for input editing.
</p>
      <p>It is also possible to run Kawa using <code class="literal">java</code> directly:
</p>
      <pre class="screen">java -jar $KAWA_HOME/lib/kawa.jar
</pre>
      <p>or:
</p>
      <pre class="screen">CLASSPATH=$KAWA_HOME/lib/kawa.jar
export CLASSPATH
java kawa.repl
</pre>
      <p>On Windows:
</p>
      <pre class="screen">set classpath=%KAWA_HOME%\lib\kawa.jar
</pre>
      <p>To run Kawa in a fresh window use the -w flag:
</p>
      <pre class="screen">kawa -w
</pre>
      <p>or
</p>
      <pre class="screen">java kawa.repl -w
</pre>
      <h4 id="idm139667880831488">Reading the documentation</h4>
      <p>The file <code class="literal">doc/kawa-manual.epub</code> contains the Kawa documention
packaged as an electronic book, which is readable by most
e-book readers.  Plugins are also available for common browsers,
for example <a class="ulink" href="http://www.epubread.com" target="_top">EPUBReader</a> for <code class="literal">firefox</code>.
</p>
      <p>Even easier is to invoke
<a class="link" href="Options.xhtml#browse-manual-option"><code class="literal">bin/kawa --browse-manual</code></a>
(or on Windows: <code class="literal">bin\kawa.bat --browse-manual</code>).
</p>
      <p>An <code class="literal">epub</code> is essentially a zip archive, which you can unzip:
</p>
      <pre class="screen">cd $KAWA_HOME/doc
unzip kawa-manual.epub
</pre>
      <p>Then you can use a plain browser
with the URL <code class="literal">file:$KAWA_HOME/doc/OEBPS/index.xhtml</code>.
</p>
    </section>
    <footer>
      <div class="navfooter">
        <p>
          Up: <a accesskey="u" href="Installation.xhtml">Getting and installing Kawa</a></p>
        <p>
        Previous: <a accesskey="p" href="Running-Java.xhtml">Getting and running Java</a></p>
        <p>
        Next: <a accesskey="n" href="Source-distribution.xhtml">Installing and using the source distribution</a></p>
      </div>
    </footer>
  </body>
</html>
